package com.yingdong.db;

import com.yingdong.annotation.PrimeKey;
import com.yingdong.annotation.AutoIncrease;
import java.util.ArrayList;
import java.util.List;

public class Account extends DBObject{
    
    private static List<Account> delList=new ArrayList<>();
   
	private static Account instance;

    /**
	 * accId
	 */
	@PrimeKey
	@AutoIncrease
    private Integer id;
    
    /**
	 * accName
	 */
	
	
    private String accName;
    
    /**
	 * 
	 */
	
	
    private String password;
    
    /**
	 * 创建时间
	 */
	
	
    private Integer createDttm;
    
 

    public Integer getId() {
	    return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
		changeDBStatus();
	}

    public String getAccName() {
	    return accName;
	}
	
	public void setAccName(String accName) {
		this.accName = accName;
		changeDBStatus();
	}

    public String getPassword() {
	    return password;
	}
	
	public void setPassword(String password) {
		this.password = password;
		changeDBStatus();
	}

    public Integer getCreateDttm() {
	    return createDttm;
	}
	
	public void setCreateDttm(Integer createDttm) {
		this.createDttm = createDttm;
		changeDBStatus();
	}
 
 	public static Account getInstance() {
		if (instance == null)
			instance = new Account();
		return instance;
	}
 
    @Override
    public String getSelectByKeyString(){
    	String sql="SELECT * FROM Account WHERE 1=1  AND id=? ";
        return sql;
    }
    
    @Override
    public String getUpdateByKeyString(){
    	String sql="UPDATE  Account SET    accName=?,  password=?,  createDttm=?    WHERE 1=1   AND id=?";
        return sql;
    }
    
    @Override
    public String getSelectAllObjectsString(){
    	String sql="SELECT * FROM Account ";
        return sql;
    }
    
    @Override
    public String getDelObjectKeyString(){
    	String sql="DELETE  FROM Account WHERE 1=1   AND id=?";
        return sql;
    }
    
    @Override
    public String getSelectAllObjectsKeyString(){
    	String sql="SELECT * FROM Account WHERE 1=1   AND id=?";
        return sql;
    }
    
    
    @Override
	public String getTableName(){
	   return "Account";
	}

}